<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">

	<title>例子2</title>
	<style>
		* {
			-webkit-box-sizing: border-box;
			-moz-box-sizing: border-box;
			box-sizing: border-box;
		}

		body,ul,li {
			padding: 0;
			margin: 0;
			border: 0;
		}

		body {
			font-size: 12px;
			font-family: ubuntu, helvetica, arial;
			overflow: hidden;
		}

		#header {
			position: absolute;
			z-index: 2;
			top: 0;
			left: 0;
			width: 100%;
			height: 45px;
			line-height: 45px;
			background: #CD235C;
			padding: 0;
			color: #eee;
			font-size: 20px;
			text-align: center;
			font-weight: bold;
		}

		#footer {
			position: absolute;
			z-index: 2;
			bottom: 0;
			left: 0;
			width: 100%;
			height: 48px;
			background: #444;
			padding: 0;
			border-top: 1px solid #444;
		}

		#wrapper {
			position: absolute;
			z-index: 1;
			top: 45px;
			bottom: 48px;
			left: 0;
			width: 100%;
			background: #ccc;
			overflow: hidden;
		}

		#scroller {
			position: absolute;
			z-index: 1;
			-webkit-tap-highlight-color: rgba(0,0,0,0);
			width: 100%;
			-webkit-transform: translateZ(0);
			-moz-transform: translateZ(0);
			-ms-transform: translateZ(0);
			-o-transform: translateZ(0);
			transform: translateZ(0);
			-webkit-touch-callout: none;
			-webkit-user-select: none;
			-moz-user-select: none;
			-ms-user-select: none;
			user-select: none;
			-webkit-text-size-adjust: none;
			-moz-text-size-adjust: none;
			-ms-text-size-adjust: none;
			-o-text-size-adjust: none;
			text-size-adjust: none;
		}

		#scroller ul {
			list-style: none;
			padding: 0;
			margin: 0;
			width: 100%;
			text-align: left;
		}

		#scroller li {
			padding: 0 0 0 10px;
			height: 40px;
			line-height: 40px;
			border-bottom: 1px solid #ccc;
			/*border-top: 1px solid #fff;*/
			background-color: #fafafa;
			font-size: 14px;
		}

		#scroller li button {
			float: right;
			height: 40px;
			border: none;
			padding: 0 20px;
			background-color: red;
			color: #fff;
			font-size: 18px;
			display: none;
			outline: none;
		}

		.iScrollVerticalScrollbar {
			width: 3px!important;
		}

	</style>

	<script src="../lib/zepto.min.js"></script>
	<script src="../lib/iscroll.js"></script>
	<script>
		window.onload = function() {
			new IScroll('#wrapper', { 
				mouseWheel: true,
				scrollbars: true,
				fadeScrollbars: true,
				shrinkScrollbars: 'scale'
			});

			/////////////////////////////////////

			$('#scroller li').on('swipeLeft', function() {
				var $this = $(this);
				$this.find('button').show()
					.end()
					.siblings()
					.find('button').hide();
			}).find('button').on('tap', function() {
				$(this).parent().remove();
			});
		}
	</script>
</head>
<body>

	<div id="header">
		<span class="back"></span>
		WEB开发大本营
		<span class="dots"></span>
	</div>

	<div id="wrapper">
		<div id="scroller">
			<ul>
				<li>Pretty row 1<button>删除</button></li>
				<li>Pretty row 2<button>删除</button></li>
				<li>Pretty row 3<button>删除</button></li>
				<li>Pretty row 4<button>删除</button></li>
				<li>Pretty row 5<button>删除</button></li>
				<li>Pretty row 6<button>删除</button></li>
				<li>Pretty row 7<button>删除</button></li>
				<li>Pretty row 8<button>删除</button></li>
				<li>Pretty row 9<button>删除</button></li>
				<li>Pretty row 10<button>删除</button></li>
				<li>Pretty row 11<button>删除</button></li>
				<li>Pretty row 12<button>删除</button></li>
				<li>Pretty row 13<button>删除</button></li>
				<li>Pretty row 14<button>删除</button></li>
				<li>Pretty row 15<button>删除</button></li>
				<li>Pretty row 16<button>删除</button></li>
				<li>Pretty row 17<button>删除</button></li>
				<li>Pretty row 18<button>删除</button></li>
				<li>Pretty row 19<button>删除</button></li>
				<li>Pretty row 20<button>删除</button></li>
				<li>Pretty row 21<button>删除</button></li>
				<li>Pretty row 22<button>删除</button></li>
				<li>Pretty row 23<button>删除</button></li>
				<li>Pretty row 24<button>删除</button></li>
				<li>Pretty row 25<button>删除</button></li>
				<li>Pretty row 26<button>删除</button></li>
				<li>Pretty row 27<button>删除</button></li>
				<li>Pretty row 28<button>删除</button></li>
				<li>Pretty row 29<button>删除</button></li>
				<li>Pretty row 30<button>删除</button></li>
				<li>Pretty row 31<button>删除</button></li>
				<li>Pretty row 32<button>删除</button></li>
				<li>Pretty row 33<button>删除</button></li>
				<li>Pretty row 34<button>删除</button></li>
				<li>Pretty row 35<button>删除</button></li>
				<li>Pretty row 36<button>删除</button></li>
				<li>Pretty row 37<button>删除</button></li>
				<li>Pretty row 38<button>删除</button></li>
				<li>Pretty row 39<button>删除</button></li>
				<li>Pretty row 40<button>删除</button></li>
				<li>Pretty row 41<button>删除</button></li>
				<li>Pretty row 42<button>删除</button></li>
				<li>Pretty row 43<button>删除</button></li>
				<li>Pretty row 44<button>删除</button></li>
				<li>Pretty row 45<button>删除</button></li>
				<li>Pretty row 46<button>删除</button></li>
				<li>Pretty row 47<button>删除</button></li>
				<li>Pretty row 48<button>删除</button></li>
				<li>Pretty row 49<button>删除</button></li>
				<li>Pretty row 50<button>删除</button></li>
			</ul>
			<ul>
				<li>item1<button>删除</button></li>
				<li>item2<button>删除</button></li>
				<li>item3<button>删除</button></li>
				<li>item4<button>删除</button></li>
				<li>item5<button>删除</button></li>
				<li>item6<button>删除</button></li>
				<li>item7<button>删除</button></li>
				<li>item8<button>删除</button></li>
				<li>item9<button>删除</button></li>
				<li>item10<button>删除</button></li>
			</ul>
		</div>
	</div>

	<div id="footer"></div>
	
</body>
</html>